package com.km.team.phsystem.web.controller;

import com.km.team.phsystem.beans.pojo.BusinessStartEndInfo;
import com.km.team.phsystem.beans.vo.ResponseData;
import com.km.team.phsystem.web.controller.base.BaseController;
import com.km.team.phsystem.web.utils.ResponseDataUtil;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author ：bastr.
 * @description：操作业务开始时间
 * @date ：2018/10/20
 */
@RestController
@RequestMapping("business")
public class BusinessStartEndInfoController extends BaseController<BusinessStartEndInfoController> {
    @GetMapping("list")
    public ResponseData selectForType() {
        List<BusinessStartEndInfo> businessStartEndInfos = businessStartEndInfoService.selectForType();
        return ResponseDataUtil.buildSuccess(businessStartEndInfos);
    }

    @PostMapping("s_e")
    public ResponseData updateById(@RequestBody List<BusinessStartEndInfo> params) {
        businessStartEndInfoService.updateById(params);
        return ResponseDataUtil.buildSuccess();
    }
}
